package com.walle.concurrenttest.waitnotify;

import java.util.concurrent.atomic.AtomicInteger;

/**
 * @author zhangjiapeng
 * @Package com.walle.concurrenttest.waitnotify
 * @Description: ${todo}
 * @date 2019/2/14 9:51
 */
public class Test {


    public static void main(String[] args) {
        Storage storage = new Storage();

        Thread producer1 = new Thread(new Producer(storage));
        Thread producer2 = new Thread(new Producer(storage));

        Thread consumer1 = new Thread(new Consumer(storage));
        Thread consumer2 = new Thread(new Consumer(storage));
        Thread consumer3 = new Thread(new Consumer(storage));

        producer1.setName("producer1");
        producer2.setName("producer2");

        consumer1.setName("consumer1");
        consumer2.setName("consumer2");
        consumer3.setName("consumer3");

        producer1.start();
        producer2.start();

        consumer1.start();
        consumer2.start();
        consumer3.start();

    }
}
